home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 85 / CD-ROM 85 / CD-ROM 85.iso / med2000 / global < prev    next >
Encoding:
Text File  |  2000-06-20  |  1.6 KB  |  52 lines

  1. <SCRIPT LANGUAGE=VBScript RUNAT=Server>
  2.  
  3. ' There will be two objects associated with each session -- a
  4. ' dtSearchEngine.Server to handle searching and display of retrieved files,
  5. ' and a SearchResults which will be needed to generate search reports.
  6.  
  7. Sub Application_OnStart
  8.     Application("SessionCount") = 0
  9. End sub
  10.  
  11. Sub Application_OnEnd
  12. End sub
  13.  
  14. Sub Session_OnStart
  15.     
  16.         Application("Conn_ConnectionString") = "DSN=PEDIA;"
  17.         Application("Conn_ConnectionTimeout") = 15
  18.         Application("Conn_CommandTimeout") = 30
  19.         Application("Conn_CursorLocation") = 3
  20.         Application("Conn_RuntimeUserName") = "Admin"
  21.         Application("Conn_RuntimePassword") = ""
  22.  
  23.     ' Create an instance of the dtSearch Engine and initialize it
  24.     Application.Lock
  25.     Application("SessionCount") = Application("SessionCount") + 1
  26.     Application.UnLock
  27.     
  28.     Dim engine
  29.     Set Engine = server.createobject("dtSearchEngine53.Server")
  30.     
  31.     ' Use DebugLogName to create a diagnostic log
  32.     'Engine.DebugLogName = "c:\dtSearchAsp.log"
  33.     
  34.     Engine.Initialize
  35.     Set Session("Engine") = Engine    
  36.     Set Session("Results") = Nothing
  37. End Sub
  38.  
  39. Sub Session_OnEnd
  40.     Set Session("Engine") = Nothing
  41.     Set Session("Results") = Nothing
  42. End Sub
  43.  
  44. 'EventName              Description
  45. 'Session_OnStart        Runs the first time a user runs any page in your application
  46. 'Session_OnEnd          Runs when a user's session times out or quits your application
  47. 'Application_OnStart    Runs once when the first page of your application is run for the first time by any user
  48. 'Application_OnEnd      Runs once when the web server shuts down
  49.  
  50. </SCRIPT>
  51.  
  52.